package test.hk.ust.cse.TwitterClient;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import hk.ust.cse.TwitterClient.TwitterClient;
import hk.ust.cse.TwitterClient.Utils;

import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.events.ShellListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Widget;
import org.junit.Test;

import twitter4j.TwitterException;

public class TwitterClientTest {
	@Test(timeout=10000)
	  public void testConstructor() throws Throwable {
	    TwitterClient tc = new TwitterClient(10, 10);
	    assertNotNull(tc);
	}	
	
	@Test(timeout=10000)
	public void testMain() throws TwitterException{
		TwitterClient twitterClient = new TwitterClient(1200, 700);
	    assertNotNull(twitterClient);
	}

	@Test(timeout=10000)
	public void testcheckSWTLibrary() {
		boolean passed =true;
		assertTrue(passed);
		
	}
	
	@Test(timeout=10000)
	  public void testdispose()
	  {	  	  
		    Display display = new Display();
		    Shell shell = new Shell(display);
		    Event a = new Event();
		    a.widget = shell;
		    a.display = display;
		    Widget wiget = a.widget;
		    display.dispose();	    
	  }
}
